﻿<Page
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
      xmlns:custom="clr-namespace:UIControls;assembly=UIControls"
	  x:Class="MovieRental_Presentation.Dashboard" 
      d:DesignWidth="1024" d:DesignHeight="600"
      mc:Ignorable="d"
      WindowTitle="Movie Rental"
	  MinWidth="900"
	  MinHeight="600" 
      ShowsNavigationUI="False">

	<Grid Background="{StaticResource backgroundBrush}">
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="230"/>
			<ColumnDefinition Width="*"/>
			<ColumnDefinition Width="250"/>
		</Grid.ColumnDefinitions>
		
		<Border Grid.Column="2" Style="{StaticResource BorderSectionStyle}">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="210"/>
					<RowDefinition Height="*"/>
				</Grid.RowDefinitions>
				<StackPanel Grid.Row="0">
					<Label Content="Menu" HorizontalAlignment="Center" Style="{StaticResource MenuLabelStyle}"/>
					<Button x:Name="customersButton" Content="Customers" Template="{StaticResource MenuButtonTemplate}" Height="40" Margin="0,8" Click="customersButton_Click" />
					<Button x:Name="moviesButton" Content="Movies" Template="{StaticResource MenuButtonTemplate}" Height="40"  Margin="0,8" Click="moviesButton_Click"/>
					<Button x:Name="statisticsButton" Content="Statistics" Template="{StaticResource MenuButtonTemplate}" Height="40" Margin="0,8" Click="statisticsButton_Click"/>
				</StackPanel>
				<Frame Content="Frame" Grid.Row="1" NavigationUIVisibility="Hidden" Source="/MovieRental.Presentation;component/Cart.xaml"/>
				
			</Grid>
		</Border>
		
		<Border Style="{StaticResource BorderSectionStyle}">
			<Grid Margin="0">
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto"/>
					<RowDefinition Height="*"/>
				</Grid.RowDefinitions>
				<StackPanel Grid.Row="0">
					<Label Content="Calendar" HorizontalAlignment="Center" Style="{StaticResource MenuLabelStyle}"/>
					<Calendar SelectedDate="{Binding SelectedDate, Mode=TwoWay}" Margin="0,8" Height="170" BorderBrush="{StaticResource borderBrush}" BorderThickness="{StaticResource borderThickness}"/>
					<Label Content="Today" HorizontalAlignment="Center" Style="{StaticResource MenuLabelStyle}"/>
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto"/>
							<ColumnDefinition Width="*"/>
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition Height="25"/>
							<RowDefinition Height="25"/>
						</Grid.RowDefinitions>
						<TextBlock Text="Loaned editions:" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{StaticResource inputBoxBrush}" FontSize="{StaticResource infoTextSize}"/>
						<TextBlock Text="Income:" HorizontalAlignment="Left" Foreground="{StaticResource inputBoxBrush}" FontSize="{StaticResource infoTextSize}" Margin="0,1.253,0,4.24" Grid.Row="1" d:LayoutOverrides="Height" VerticalAlignment="Center"/>
						<TextBlock Text="{Binding LoansCount}" VerticalAlignment="Center" HorizontalAlignment="Right" Foreground="{StaticResource inputBoxBrush}" FontSize="{StaticResource infoTextSize}" Grid.Column="1"/>
						<TextBlock Text="{Binding Income, StringFormat=\{0:c\}}" HorizontalAlignment="Right" Foreground="{StaticResource inputBoxBrush}" FontSize="{StaticResource infoTextSize}" Grid.Column="1" RenderTransformOrigin="0.431,1.991" Margin="0,1.253,0,4.24" Grid.Row="1" d:LayoutOverrides="Height" VerticalAlignment="Center" />
					</Grid>
					<Label Content="On Sale" HorizontalAlignment="Center" Style="{StaticResource MenuLabelStyle}" Margin="0,8,0,0"/>
				</StackPanel>
				<ListBox Grid.Row="1" ItemsSource="{Binding OnSaleEditions}" ItemContainerStyle="{StaticResource EditionItemStyle}" ItemTemplate="{StaticResource EditionOnSaleTemplate}" Style="{StaticResource OnSaleListStyle}"/>
			</Grid>
		</Border>
		
		<Border Grid.Column="1" Style="{StaticResource BorderSectionStyle}">
			<Grid Margin="0">
				<Grid.RowDefinitions>
					<RowDefinition Height="80"/>
					<RowDefinition Height="*"/>
					<RowDefinition Height="Auto"/>
				</Grid.RowDefinitions>
				<Label Content="Debtors" HorizontalAlignment="Center" d:LayoutOverrides="Height, GridBox" Grid.ColumnSpan="2" VerticalAlignment="Top" Style="{StaticResource MenuLabelStyle}"/>
				<custom:SearchTextBox Text="{Binding SearchString, Mode=TwoWay}" VerticalAlignment="Bottom"  Margin="0,0,0,8" Name="searchTextBox" BorderBrush="{DynamicResource borderBrush}" LabelText="Customer" SelectionBrush="{DynamicResource itemBorderBrush}" BorderThickness="2" Search="searchTextBox_Search" />
				<ListBox x:Name="cartsListBox" ItemsSource="{Binding Carts}" Grid.Row="1" Style="{DynamicResource CartsListStyle}" ItemContainerStyle="{DynamicResource NoSelectionColorItemStyle}" ItemTemplate="{DynamicResource CartDefaultTemplate}" MouseDoubleClick="cartsListBox_MouseDoubleClick"/>
			</Grid>
		</Border>
        
	</Grid>
</Page>
